package org.numanint.code;

import java.util.ArrayList;
import java.util.HashMap;


public class DaoXmlGenerator extends Generator {

	public DaoXmlGenerator(GeneratorProperties p){
		super(p);
	}
	
	public void generator(ReverseEngineer reveng) throws Exception{	
			HashMap<String,Object> data = new HashMap<String,Object>();
			ArrayList<String> daoArray = new ArrayList<String>();
			for(int i=0;i<reveng.getTableClasss().length;i++){	
				String className = ConventUtils.t2c(reveng.getTableClasss()[i].getTableName());		
				daoArray.add(className);
			} 
			HashMap<String,Object> daoMap=new HashMap<String,Object>();
			daoMap.put("daoList",daoArray);
			daoMap.put("properties", getProperties());
			data.put(ConventUtils.lowerFirstChar(getProperties().getProjectName())+"-dao.xml", daoMap);
			super.setData(data);
			super.generator();
		
	}	
}
